<?php

	$langcode=$this->lang->lang();
	if($langcode=='vn')
	{

		$searchaction=base_url()."vn/tim-kiem/";
		$sample='Sản phẩm rất tiện dụng cho bạn ';
	}
	else
	{
		$searchaction=base_url()."en/search/";
		$sample='You give one hundred percent every single day ';
	}
?>
	<div id="page_main">
	    <!-- begin: #Main -->
        <div id="main">
            <div class="sanpham">
                <div class="col1">
                    <div class="search">
                        <form name="searchForm" id="searchForm" method="post" action="<?php echo $searchaction; ?>">
                            <div class="timkiem">
                                <input type="text" name="searchtxt" value="<?php echo $this->lang->line('keyword_search');?>" onblur="if(this.value=='') this.value='<?php echo $this->lang->line('keyword_search');?>';" onfocus="if(this.value=='<?php echo $this->lang->line('keyword_search');?>') this.value='' ; " maxlength="30" class="key"/>
                                <input type="submit" name="submit" value="<?php echo $this->lang->line('search_bt');?>" class="bt_send" />
                                <div class="clear_left"></div>
                            </div>
                        </form>
                    </div>
                    <div class="p2t">
                        <div class="menu_left_top"><p><?php echo $this->lang->line('fm_menuproduct1');?></p></div>
                        <div class="menu_left_1">
                        <?php echo $_left; ?>
                        </div>
                    </div>
                </div>
                <div class="col2">
                    <div class="title border_bottom">
					<p class="p10b">
					<?php echo $title; ?>					
					</p></div> 
					<br />
                    <div class="product">
					<div class="border_bottom" style="color:#002D5A; font-size:14px; font-weight:bold"><label><?php echo $this->lang->line('fm_product'); ?></label></div><br />
                        <ul>
 <?php 
			if(empty($list_product))
			{
				echo $this->lang->line('search_pro_error');	
			}
			else
			{
			  for($i=0;$i<count($list_product);$i++)
			  {
					
?>							
                            <li>
                                <div class="pro bd1px_pp">
                                    <div class="pro_1">
                                        <div class="min_height">
                                            <div class="p10t">
                                            <img src="<?php echo base_url(); ?>/assets/auto_thumbnail/timthumb.php?src=<?php echo base_url(); ?>upload_file/product/<?php echo $list_product[$i][0]; ?>&h=123&w=125&zc=1"/>
                                            </div>
                                            <div class="p10t">
                                                <label><a style="text-decoration:none; color:#000000" href="<?php echo $currenturl.$list_product[$i][3]."/".$list_product[$i][2].".html" ?>" title="<?php  echo $list_product[$i][1]; ?>"><?php  echo $list_product[$i][1]; ?></a></label>
                                               
                                            </div>
                                        </div>
                                        <div class="chitiet_sanpham">
                                            <a href="<?php echo $currenturl.$list_product[$i][3]."/".$list_product[$i][2].".html" ?>"><?php echo $this->lang->line('fviewdetail'); ?></a>
                                        </div>
                                    </div>
                                </div>
                            </li>
<?php
			  }
			}
?>
                        </ul>
                        <div class="clear_left"></div>
                    </div><br />
<div class="product">
<div class="border_bottom" style="color:#002D5A; font-size:14px; font-weight:bold"><label><?php echo $this->lang->line('fm_news'); ?></label></div>
<br />
<?php 

if (!empty($listsearch_result))

{
			  	//var_dump ($listsupport); 

				for($i=0;$i<count($listsearch_result);$i++)

				{

?>
<div class="float_left w450px p10l">
                                    <label><?php echo "<a href='".$currentlang."/".$listsearch_result[$i][5]."/".$listsearch_result[$i][0].".html' title='".$listsearch_result[$i][2]."'  alt='".$listsearch_result[$i][2]."'>"; ?><?php echo $listsearch_result[$i][2]; ?><?php echo "</a>"; ?></label>&nbsp;<i>(<?php echo date('d-m-Y',strtotime($listsearch_result[$i][4])); ?>)</i>
                                </div><div class="clear_left"></div>

<?php 

				} 

}

else

{

	echo $this->lang->line('search_error');	

}

?>  
</div>					
                    <div class="clear_right"></div>
                </div>
                <div class="clear_left"></div>
            </div>
        </div>
        <!-- end: #Main -->     

<script>
$(document).ready(function(){
   $("#home_current").addClass('current');
});
</script>